package com.teaut.dota.hider.entity;

import com.teaut.dota.hider.entity.common.AbstractBaseEntity;
import com.teaut.dota.hider.entity.common.MenuType;
import com.teaut.dota.hider.entity.common.Status;
import com.teaut.dota.hider.entity.common.Tenant;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
@Entity
public class MenuEntity extends AbstractBaseEntity {

    @NotBlank(message = "菜单名 不能为空")
    private String name;
    private String descr;
    private String url;
    private String icon;
    @Enumerated(EnumType.STRING)
    private MenuType type;

    @Enumerated(EnumType.STRING)
    private Status state;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private MenuEntity parent;

}